package org.infodavid.common.registry;

import java.io.Serializable;

/**
 * The Interface IRegistryListener.
 * @param <K> the type of the keys
 * @param <E> the type of the elements
 */
public interface IRegistryListener<K extends Serializable,E extends Serializable> {

	/**
	 * Called before register.
	 * @param evt the event
	 */
	void preRegister(IRegistryEvent<K,E> evt);

	/**
	 * Called after register.
	 * @param evt the event
	 */
	void postRegister(IRegistryEvent<K,E> evt);

	/**
	 * Called before unregister.
	 * @param evt the event
	 */
	void preUnregister(IRegistryEvent<K,E> evt);

	/**
	 * Called after unregister.
	 * @param evt the event
	 */
	void postUnregister(IRegistryEvent<K,E> evt);

	/**
	 * Undefined.
	 * @param evt the event
	 * @return the optional element to pass to caller
	 */
	E undefined(IRegistryEvent<K,E> evt);

	/**
	 * Called before clear.
	 * @param evt the event
	 */
	void preCleared(IRegistryEvent<K,E> evt);

	/**
	 * Called after clear.
	 * @param evt the event
	 */
	void postCleared(IRegistryEvent<K,E> evt);
}
